home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / util / shell / ZShell.lha / ZShell27 / Old / ZShell.doc < prev   
Text File  |  1995-06-02  |  32KB  |  1,009 lines

  1.  
  2.         ZSHELL V1.30 (C) 1990,91 PAUL HAYTER
  3.                  ======================================
  4.  
  5.     OVERVIEW
  6.     ========
  7.  
  8.     ZShell is a small CLI shell. I needed a shell which had my
  9.     favourite features of CSH yet was a lot smaller, so it would load
  10.     faster and use much less memory.
  11.  
  12.  
  13.     FEATURES
  14.     ========
  15.  
  16.     *  about 13K.
  17.     *  Supports the standard housekeeping commands
  18.         dir , cd , rename , mkdir , delete , copy , path , info ,
  19.         type.
  20.     *  Function key aliasing.
  21.     *  Command aliasing.
  22.     *  Reverse Polish Calculator.
  23.     *  Script file execution.
  24.     *  1024 byte command line history.
  25.     *  Command line editing.
  26.     *  Can examine the KickTagPtr,CoolCapture etc.
  27.     *  Has a cold reset command.
  28.     *  Wild Card file descriptions.
  29.     *  Special programmers status mode.
  30.     *  Simple 'More' type text viewer.
  31.     *  Has a resident command.
  32.     *  IF ... ELSE ... ENDIF constructs.
  33.  
  34.     SPECIAL CHARACTERS
  35.     ==================
  36.  
  37.     The following characters have special meanings to ZShell.
  38.  
  39.      "  "    Double quotes. Used to enclose strings with spaces.
  40.         eg "hello world".
  41.      ^n    Hat character. Prefixes a control character letter (n).
  42.         Used in ASK, ECHO, & SET commands. eg ^L   <-clear screen
  43.      %n    Percent prefixes a number (0-7) to specify an optional
  44.         parameter for command aliases. Used in SET command.
  45.         Can also be used to specify prompt arguments. See PROMPT
  46.         command.
  47.      $n    Dollar prefixes a number (0-7) and corresponds to an
  48.         optional parameter specified with %n (above).
  49.      *?~[]    Wildcard characters. * matches 0 to n characters. ? matches
  50.         one character, ~ negates the following wild card, and [ ] 
  51.         surround a class of characters to match. See WILD CARDS.
  52.      \n    Backslash prefixes a special character, whose meaning you
  53.         want ignored. eg echo "hello \"fred\""  (hello "fred")
  54.      ;    Semi-colon seperates multiple commands on one line.
  55.         eg. cd df1:;dir
  56.      >    redirect output.
  57.      <    redirect input.
  58.      >>    redirect append output.
  59.  
  60.  
  61.     ZSHELL INBUILT COMMANDS
  62.     =======================
  63.     
  64.     Most commands can be aborted by depressing Control-C.
  65.  
  66.     A textual error message will be displayed if an AmigaDOS error
  67.     occurs.
  68.     ------------------------------------------------------------------------
  69.     ADDBUFFERS drive number_of_buffers
  70.  
  71.     * ADDBUFFERS increases disk access speed on the specified drive by
  72.       adding a number of sector cache buffers. Each additional buffer
  73.       reduces memory by about 500 bytes. Generally, 25-30 buffers is
  74.       optimal.
  75.  
  76.     eg.    addbuffers df0: 25
  77.         addbuffers df1: 10
  78.     ------------------------------------------------------------------------
  79.     ASK [question]
  80.  
  81.     * ASK prompts the user with a question requiring a Yes or No
  82.       answer. If the first letter of the users response is 'Y', ASK
  83.       returns code WARN. Any other letter will result in return code OK.
  84.       The question can include ASCII characters as well as control
  85.       codes as per the ECHO command.
  86.  
  87.     eg.    ask "Do you want commands copied to ram? "
  88.         if warn
  89.             copy c: ram:
  90.         endif
  91.     ------------------------------------------------------------------------
  92.     ASSIGN [logical name:] [directory]
  93.  
  94.     * ASSIGN will assign a logical device name to a disk directory.
  95.  
  96.     eg.    assign z: df1:zshell_source
  97.  
  98.     Now if you do a DIR Z: you will get a directory of df1:zshell_source.
  99.     Similarly, the default device names can be reassigned.
  100.  
  101.     eg.    assign libs: df1:libs
  102.  
  103.     * Typing ASSIGN with no parameters, will list the current device
  104.       assignments.
  105.     eg.    assign
  106.  
  107.     * NOTE: the logical name you give to the command MUST end in a
  108.             colon (:)
  109.         Assign is compatible with the amigados assign command.
  110.     ------------------------------------------------------------------------
  111.     CD [destination]
  112.  
  113.     * Changes the current directory to 'destination'. If no parameter
  114.       is given, the current directory's name is shown.
  115.  
  116.     eg.   cd ram:
  117.     ------------------------------------------------------------------------
  118.     COPY [-r] source1 [sourcefile2] [sourcefile3]... destination
  119.  
  120.     * There are 6 derivatives of the copy command.
  121.  
  122.      1. copy file to file.
  123.  
  124.         eg.    COPY C:LIST RAM:LS
  125.  
  126.      2. copy file to a directory.
  127.  
  128.         eg.    COPY C:MOUNT DF1:C
  129.  
  130.      3. copy multiple files to a directory.
  131.  
  132.         eg.    COPY L:PORT-HANDLER L:DISK-VALIDATOR DF1:L
  133.  
  134.      5. copy files in a directory to another directory.
  135.  
  136.         eg.    COPY C: DF2:C
  137.  
  138.      4. copy multiple directories to a single directory.
  139.  
  140.         eg.    COPY L: DEVS: C: RAM:
  141.  
  142.      6. Recursively copy all files and subdirectories within the source
  143.         directory to the destination directory.
  144.  
  145.         eg.    COPY -R DF0: DF1:
  146.  
  147.     Other examples:
  148.  
  149.     eg.    copy fred wilma
  150.     eg.    copy c:dir df1:c
  151.     eg.    copy dir list type cd df1:c
  152.     eg.    copy df0:devs df1:devs
  153.     eg.    copy *.s ram:
  154.         copy df0: df1:        {only copy the files in df0: to df1:}
  155.     ------------------------------------------------------------------------
  156.     DELETE [-r] source1 [source2] [source3] [source4]... [source11]
  157.  
  158.     * Deletes up to 11 files or directorys ('source1'...'source11').
  159.     * If you specify the -r option when deleting a directory, then all
  160.       subdirectories are recursively deleted also. Otherwise (if the -r
  161.       option is not given) only the files in the specified directory are
  162.       deleted.
  163.  
  164.     eg.    delete fred wilma barney betty dino
  165.         delete df0:devs df1:c df1:data ram:
  166.         delete menu
  167.         delete -r devs:
  168.         delete -r df1:
  169.     ------------------------------------------------------------------------
  170.     DIR [source]
  171.  
  172.     * Lists the directory of the 'source' to the screen. Hitting space
  173.       will pause the listing and backspace will continue it. Files are
  174.       shown with their size in bytes. DIR lists the current directory
  175.       if no parameter is given. If 'source' is a filename, then only
  176.       that file is listed.
  177.  
  178.     eg.   dir df0:
  179.     ------------------------------------------------------------------------
  180.     DIW [source]
  181.  
  182.     * This is identical to the above DIR command ,except that the
  183.       directory is printed in two vertical columns. DIW is a pseudonym
  184.       for Directory Wide.
  185.  
  186.     eg.   diw devs:
  187.     ------------------------------------------------------------------------
  188.     ECHO [string]
  189.  
  190.     * Prints the 'string' to the screen. If you want spaces in the
  191.       string, make sure the whole string is enclosed in quotes. If you
  192.       want to print special control characters (eg. ctrl-L clear screen)
  193.       then prefix the control letter with a ^ character. If you want to
  194.       print double quotes, then use the \ character before the qoutes.
  195.  
  196.     eg.    echo hello
  197.         echo "hello world"
  198.         echo "^Lthe screen was just cleared"
  199.         echo "^Lline 1^Jline 2^Jline 3"
  200.         echo "these are double quotes ->\""
  201.  
  202.     * Some common control codes are:
  203.  
  204.         ^J    linefeed.
  205.         ^L    clear screen.
  206.         ^M    carriage return.
  207.         ^X    clear line.
  208.         ^[    escape.
  209.  
  210.     ------------------------------------------------------------------------
  211.     ELSE
  212.  
  213.     * ELSE marks the middle of an IF statement. All statements
  214.       following it, and before the ENDIF statement will be executed
  215.       only if the IF condition is FALSE. See IF for usage.
  216.  
  217.     ------------------------------------------------------------------------
  218.     ENDIF
  219.  
  220.     * ENDIF marks the end of an IF statement. See IF for usage.
  221.  
  222.     ------------------------------------------------------------------------
  223.     EXEC source
  224.  
  225.     * Executes the ZShell script file of name 'source'. All ZShell
  226.       commands, as well as commands from disk are valid within a
  227.       script file.
  228.  
  229.     eg.   exec install_hard_disk
  230.     ------------------------------------------------------------------------
  231.     EXIT
  232.  
  233.     * Exits you from the shell back to the AmigaDOS CLI prompt.
  234.  
  235.     eg.   exit
  236.     ------------------------------------------------------------------------
  237.     FAILAT [failat level]
  238.  
  239.     * FAILAT sets the error code level at which scripts (and multiple
  240.       commands on one line) will be aborted. The default level is 10.
  241.       Most commands return 10 as a serious error, while compilers
  242.       returning Warning type errors will return 5. Hence, the default
  243.       of 10 will allow Warnings to occur without the script (or line)
  244.       being aborted.
  245.  
  246.     eg.    failat 20    {sets failat level to 20}
  247.  
  248.     * If you do not specify a failat level, the current setting is
  249.       shown.
  250.  
  251.     eg.    failat
  252.     ------------------------------------------------------------------------
  253.     GOTO label
  254.  
  255.     * GOTO searches for the label within the current script file. If it
  256.       finds it, execution continues from that point onwards. Labels
  257.       are specified using the LABEL command.
  258.  
  259.     eg.    label myloop
  260.         diw ram:
  261.         ask "list ram again? "
  262.         if warn
  263.             goto myloop
  264.         endif
  265.     ------------------------------------------------------------------------
  266.     HELP
  267.  
  268.     * Lists to the screen the names of all available ZShell commands.
  269.       HELP can also be invoked by hitting the HELP key.
  270.  
  271.     eg.   help
  272.     ------------------------------------------------------------------------
  273.     HTYPE source
  274.  
  275.     * HTYPE outputs a hex listing of the file specified. Output is the
  276.       same as the M command. <SPACE> pauses the listing, <BACKSPACE>
  277.       gets it going again, and <CTRL C> will abort the listing.
  278.  
  279.     eg.    htype c:list 
  280.     ------------------------------------------------------------------------
  281.     IF [NOT][WARN][ERROR][FAIL][EXISTS file]
  282.  
  283.     * The IF command allows conditional execution of statements
  284.       following it.
  285.     * If the condition specified is true, then execution continues
  286.       after the IF statement until either an ENDIF or ELSE statement
  287.       is encountered. If it is an ELSE statement, then all statements
  288.       between the ELSE and the closing ENDIF are skipped.
  289.     * If the condition is false, then all statements after the IF and
  290.       before either an ENDIF or ELSE statement are skipped. If an ELSE
  291.       is encountered, then execution continues for all statements after
  292.       the ELSE and before the closing ENDIF.
  293.     * IF can examine the state of the return code from the last command
  294.       execute with WARN, ERROR, and FAIL tests. You can test for the
  295.       non existence of such a state by including the optional NOT
  296.       parameter.
  297.  
  298.     eg.    IF WARN
  299.             echo "last command returned warnings"
  300.         ELSE
  301.             echo "last command did not return warnings"
  302.         ENDIF
  303.  
  304.         IF not fail
  305.             echo "last command did not fail"
  306.         ENDIF
  307.  
  308.     * IF can also test for the existence of a file or directory.
  309.  
  310.     eg.    IF EXISTS system/format
  311.             echo "this disk has a format command"
  312.             echo "you can look yourself. I'm not joking"
  313.         ENDIF
  314.  
  315.         IF not exists ram:ed
  316.             copy c:ed ram:
  317.         ENDIF
  318.  
  319.     ------------------------------------------------------------------------
  320.     INFO [disk]
  321.  
  322.     * Shows the number of bytes free on the disk specified ,or the
  323.       current disk if you don't specify one.
  324.  
  325.     eg.   info df0:
  326.     ------------------------------------------------------------------------
  327.     JOIN [sourcefile1] [sourcefile2] ... [sourcefile11] destfile
  328.  
  329.     * JOIN concatenates up to 11 files to form a new file (destfile).
  330.  
  331.     eg.    join fred.doc roy.doc dog.doc mydocs.doc
  332.     ------------------------------------------------------------------------
  333.     LABEL label
  334.  
  335.     * LABEL specifies a destination for the GOTO command. See GOTO.
  336.     ------------------------------------------------------------------------
  337.     M [start_address] [end_address]
  338.  
  339.     * M is a memory contents dumping command.
  340.  
  341.     * Typing M with a start and end address will display the hex and
  342.       ASCII contents of those bytes in the memory locations specified.
  343.     * Typing M with only a start address will display 320 bytes
  344.       starting at the location specified.
  345.     * Typing M with no parameters will display 320 bytes starting
  346.       from the current memory location.
  347.     * The current memory location is always one location higher than
  348.       the last location shown by a prior M command.
  349.  
  350.     eg.   m $70000 $77fff
  351.           m $fc0000
  352.           m 0
  353.           m
  354.     ------------------------------------------------------------------------
  355.     MEM
  356.  
  357.     * Shows the available memory as ,1.Total chip memory free,
  358.                      2.Total fast memory free,
  359.                     and  3.Total memory free.
  360.     eg.    mem
  361.     ------------------------------------------------------------------------
  362.     MKDIR [directory1] [directory2] ... [directory11]
  363.  
  364.     * Creates one or more directorys of the names specified.
  365.  
  366.     eg.    mkdir shells
  367.         mkdir c l s libs devs fonts
  368.         mkdir devs/printers ram:c
  369.     ------------------------------------------------------------------------
  370.     MORE source [line count]
  371.  
  372.     * MORE acts as a simple text file viewer. By default, it will show
  373.       23 lines of a text file, then wait for some user input.
  374.       Commands within MORE are:-
  375.         <SPACE>        - advance you 20 lines forward.
  376.         <BACKSPACE>    - display text from 20 lines back.
  377.         <RETURN>    - advance 1 line.
  378.         <B>        - goto end(Bottom) of text file.
  379.         <T>        - goto top of text file.
  380.         
  381.       Typing anything else will abort you back to the shell.
  382.  
  383.     eg.    more readme
  384.  
  385.     * Specifying the optional line count will allow you to show more
  386.       than the default 23 lines. {Very useful for large borderless PAL
  387.       screens}
  388.  
  389.     eg.    more contents 30
  390.         more readme 25
  391.     ------------------------------------------------------------------------
  392.     PATH [-a] [path1] [path2] [path3] [path4] ... [path11]
  393.  
  394.     * PATH defines the search path used by ZShell when searching
  395.       for disk based commands.
  396.     * By omitting the -a option, you can specify ZShell's entire command
  397.       search path. It will be defined as resident_commands,
  398.       current_directory, then path1, then path2, then path3, then path4,
  399.       upto path 11
  400.  
  401.     eg.    path c: ram:c df0: df1:
  402.  
  403.       This example will make it so that if you type a command which is
  404.       not internal to Zshell, the resident list will be searched for it,
  405.       then the current directory, then the c: directory, then the ram:c
  406.       directory, then df0:, and finally df1:
  407.  
  408.     eg.    path ram: df0: df0:c df1: df1:c c:
  409.  
  410.       Zshell will try to find the command you type in the resident list,
  411.       then current directory, then ram:, then df0:, then df0:c, then
  412.       df1:, then df1:c, then c:
  413.  
  414.     * By including the -a option, you can add a number of paths onto the
  415.       existing command search path.
  416.  
  417.     eg.    path -a df2:c
  418.  
  419.       Adds the directory df2:c onto the existing command search path.
  420.  
  421.     eg.    path -a df1:bin df1:myprogs
  422.  
  423.       Adds the two directories df1:bin and df1:myprogs onto the existing
  424.       command search path.
  425.  
  426.     * If, however, you type path with no parameters, the current search
  427.       path (excluding resident list and current) will be displayed.
  428.  
  429.     ------------------------------------------------------------------------
  430.     PROMPT [string]
  431.  
  432.     * If no parameter is typed ,then the current prompt setting is
  433.       shown.
  434.  
  435.     eg.    prompt
  436.  
  437.     * If a prompt string is specified, then the current prompt setting
  438.       is changed to that string. The character '%' specifies a special
  439.       prompt option.
  440.  
  441.         %p    Insert current directory name.
  442.         %n    Insert CLI number.
  443.  
  444.     eg.   prompt "%p> "    {default prompt. Show current directory + '>'}
  445.           prompt "Hello ."  {shows 'Hello .' at the start of every line}
  446.           prompt "%n.%p> "    {show CLI number, then current dir, then '>'}
  447.     ------------------------------------------------------------------------
  448.     RELABEL drive newname
  449.  
  450.     * RELABEL renames the disk specified with the newname given.
  451.  
  452.     eg.    relabel Empty: MY_DISK
  453.         relabel df0: FISHMONGER
  454.     ------------------------------------------------------------------------
  455.     RENAME source destination
  456.  
  457.     * Renames the file or directory of name 'source' to that of
  458.       'destination'. You can use this to move files on a disk.
  459.  
  460.     eg.    rename df0:c/list df0:ls    (moves and renames)
  461.         rename avail mem
  462.     ------------------------------------------------------------------------
  463.     RESET
  464.  
  465.     * Performs a COLD reset of your Amiga. i.e. RAD will go, and you
  466.       will get back fast memory that may have been disabled. And viruses
  467.       should disappear.
  468.  
  469.     eg.    reset
  470.     ------------------------------------------------------------------------
  471.     RESIDENT [command1] [command2] ... [command11]
  472.  
  473.     * RESIDENT allows you load commands into memory, such that they
  474.       will execute immediately, rather than be loaded from disk all the
  475.       time. The benefit of RESIDENT over saving commands on the RAM:
  476.       disk is that only one copy of the command is in memory all the
  477.       time. RAM: based commands will use up twice as much memory when
  478.       the command is being executed.
  479.  
  480.     * The limitation of RESIDENT is that only certain commands will
  481.       work. Generally, all commands which have their PURE bit (see
  482.       SETPROT command) set can be made RESIDENTABLE. However, RESIDENT
  483.       does not check whether the PURE bit is set before loading, and
  484.       hence you can try out commands to see if they work. They'll
  485.       always work the first time. Its only when executing the 2nd
  486.       time that the Amiga will likely crash.
  487.     NB: Crunched programs will most likely not work.
  488.  
  489.     * Typing RESIDENT with no parameters will show the current list 
  490.       of resident commands.
  491.  
  492.     * Typing up to 11 command names after RESIDENT will make those
  493.       commands resident. ZShell will search the command search path
  494.       to try and find them.
  495.  
  496.     eg.    resident c/list c/cd c/date c/avail
  497.         resident ed
  498.  
  499.     ------------------------------------------------------------------------
  500.     RETURN [error_code]
  501.  
  502.     * RETURN forces a script file to end, and return to the shell.
  503.       An optional error code can be passed back (ie. 5=WARN 10=ERROR
  504.       etc).
  505.  
  506.     eg.    return 5
  507.         return
  508.     ------------------------------------------------------------------------
  509.     RPN expression
  510.  
  511.     * RPN evaluates the 'expression' as a reverse polish expression,
  512.       and displays the answer in decimal and hex notation. Reverse
  513.       Polish Notation is used in Forth and in Hewlett Packard
  514.       calculators(the best calculators in the world). It is based on
  515.       how arithmetic is actually done at the lowest possible level.
  516.  
  517.     eg.    rpn 4 5 +
  518.  
  519.       This gives the answer 9. When a number is typed, it is 'pushed'
  520.       onto the arithmetic stack. The + always adds the last two numbers
  521.       on the stack.
  522.  
  523.     eg.    rpn 7 2 3 + -
  524.  
  525.       This gives the answer 2. It is the same as {7 - (2 + 3)}. See,
  526.       7 is first pushed onto the stack, followed by 2, then 3. The +
  527.       adds together the 2 and 3 and leaves the result 5 on the stack.
  528.       Which means that the number 7 followed by 5 are left on the
  529.       stack. The - subtracts the last entry (5) on the stack from the
  530.       one before it (7), leaving the result 2
  531.  
  532.     eg.
  533.         12 * (3 + 9)            > rpn 12 3 9 + *
  534.         (15 - 4) * (6 + 18)        > rpn 15 4 - 6 18 + *
  535.         (6 * ((87 + 13) / (2 * 25)))    > rpn 6 87 13 + 2 25 * / *
  536.  
  537.     * RPN only performs 32 bit integer arithmetic.
  538.  
  539.     * The operators + - * / & | @ ! are supported.
  540.       The & allows logical AND'ing. And | allows logical OR'ing.
  541.       The @ is similar to PEEK in BASIC.
  542.  
  543.     eg.    rpn $c00000 @
  544.  
  545.       This prints out the long word in memory locations $c00000 -
  546.       $c00003.
  547.  
  548.       Conversely, ! is similar to POKE in BASIC
  549.  
  550.     eg.    rpn $aa55aa55aa $40000 !
  551.  
  552.       This pokes the long word $aa55aa55aa into locations $40000
  553.       thru $40003.
  554.  
  555.     * RPN also supports hexadecimal and binary  numbers.
  556.       If you prefix the number with $, the number is hex
  557.       If you prefix the number with %, it is binary.
  558.  
  559.     eg.    rpn $c00000 $a0 16 * +
  560.         rpn $aa $f0 &
  561.         rpn $80 $20 $08 $01 | | |
  562.         rpn $67 %11001011 &
  563.  
  564.     * RPN can also be used to perform base conversions (to dec or hex)
  565.  
  566.     eg.    rpn $ca
  567.         rpn %10110001
  568.         rpn 45
  569.     ------------------------------------------------------------------------
  570.     SET [variable] [definition]
  571.  
  572.     * SET assigns a variable name to a definition. The variable name
  573.       can be up to 15 characters long, and the definition can be up to
  574.       about 360 characters long.
  575.  
  576.       Function Keys
  577.       -------------
  578.     eg.   set f1 "ed df0:s/startup-sequence^M"
  579.  
  580.       This example assigns the unshifted F1 key to the text enclosed in
  581.       quotes. Note that the ^M characters puts an auto carriage return
  582.       in the definition.
  583.  
  584.     eg.   set F10 "cd df0:^M"
  585.  
  586.       This sets shifted F10 to 'cd df0:<CR>'.
  587.  
  588.      Other egs    set f2 "cd df1:^M"
  589.             set f4 "genim2 "
  590.             set F9 "scribble df0:text/"
  591.             set f1 "a68k z.a;blink z.o to z^M"
  592.  
  593.       Command Aliases
  594.       ---------------
  595.     * The secondary use of set is to assign command aliases.
  596.  
  597.     eg.    set mv rename
  598.  
  599.       This allows an alternate name for rename. i.e. mv.
  600.       So you could type
  601.  
  602.         mv oldname newname    {to rename oldname to newname}
  603.     Or
  604.     eg.    set as a68k
  605.         set pp powerpacker
  606.         set du dirutil
  607.         set go "a68k zsh.s;blink zsh.o to zsh"
  608.         set cped "copy df0:c/ed"
  609.  
  610.       You would use this last alias, if you need to copy a particular
  611.       file a lot. So, to copy c/ed to ram: use:-
  612.  
  613.         cped ram:
  614.  
  615.     * You can also pass external parameters to an alias.
  616.  
  617.     eg.    set al    "%1 a68k $1.s;blink $1.o to $1"
  618.  
  619.     Typing
  620.             al test
  621.  
  622.     will assemble test.s using a68k, then blink test.o to become test.
  623.  
  624.     You can specify upto eight parameters to pass to a command alias.
  625.     At the start of the set definition, specify the parameters to pass
  626.     with the variables %0 thru %7. These need not be in sequence. The
  627.     first %n will be assigned to the first parameter, the 2nd %n to
  628.     the 2nd parameter etc.
  629.  
  630.     Insert the corresponding variables $0 thru $7 at the points in the
  631.     set definition where that parameter is to appear.
  632.  
  633.     eg.    set disp "%1 %2 %3 echo \"$3 $2 $1\""
  634.         set cram "%0 %1 %2 %3 copy $0 $1 $2 $3 ram:"
  635.         set go "%5 %1 %6 %2 echo \"1st-$5 2nd-$1 3rd-$6 4th-$2\""
  636.  
  637.     * Command aliases can be nested to 1 level.
  638.  
  639.     eg.    set cls "echo ^L";set cdir "%1 cls;cd $1;diw"
  640.  
  641.     * An important point about aliases, is that you can redefine the
  642.       existing internal command names.
  643.  
  644.     eg.    set help "type help_screen"
  645.  
  646.       This would make it so that pressing HELP or typing H E L P would
  647.       not generate the standard help command list, but would type the
  648.       file called  help_screen to the screen. Similarly
  649.  
  650.     eg.    set copy c:copy
  651.         set info c:dfree
  652.         set mem c:avail
  653.  
  654.     * Typing set with no parameters at all, will generate a list of all
  655.       current definitions.
  656.  
  657.     eg.    set
  658.     ------------------------------------------------------------------------
  659.     SETPROT [filename] [h|s|p|a|r|w|e|d]
  660.  
  661.     * Allows you to alter/see the protection bits associated with a file.
  662.  
  663.     * SETPROT filename
  664.       Shows the protection bits for the file specified.
  665.  
  666.     eg.   setprot editor
  667.  
  668.     * SETPROT filename [h|s|p|a|r|w|e|d]
  669.       Toggles the specified protection bits on the file.
  670.  
  671.     eg.   setprot editor pd
  672.       If 'editor' was already pure, then the pure bit would be reset.
  673.       If 'editor' was not pure, then the pure bit would be set.
  674.       If 'editor' was deletable, then the delete bit would be reset.
  675.       If 'editor' was not deletable, then the delete bit would be set.
  676.  
  677.     eg.   setprot game hprwd
  678.     eg.   setprot monitor hsparwed
  679.  
  680.     Bits:    'h'    hidden    V1.3
  681.         's'    script    V1.3
  682.         'p'    pure    V1.3
  683.         'a'    archive    V1.3
  684.         'r'    readable
  685.         'w'    writable
  686.         'e'    executable
  687.         'd'    deletable    <- V1.2 only understands this bit
  688.     ------------------------------------------------------------------------
  689.     SLEEP timeout
  690.  
  691.     * SLEEP halts processing for the time given. Timeout is in seconds.
  692.  
  693.     eg.    echo "I'll wait a minute"
  694.         sleep 60
  695.  
  696.     ------------------------------------------------------------------------
  697.     STACK [size]
  698.  
  699.     * Allows you to view or alter the current stack size.
  700.  
  701.     eg.    stack        [shows the current stack size]
  702.            stack 30000      [sets current stack = 30000 bytes]
  703.            stack 10000    [sets current stack = 10000 bytes]
  704.  
  705.     ------------------------------------------------------------------------
  706.     STATUS [-y|-n]
  707.  
  708.     * Activates or deactivates the programmers status line.
  709.     
  710.     eg.    status -y    [activates status line]
  711.         status -n    [deactivates status line]
  712.  
  713.       The status line (if activated) will only appear once a disk based
  714.     or resident program has been executed. The line appears as follows:
  715.  
  716.     RETURN: 0  time = 00:00:23.66  changes-> chip: 0  fast: 0  total: 0
  717.  
  718.     Return shows the return code that the program returned in D0 (usually
  719.     = 0). Time shows how long the program took to execute in hours,
  720.     minutes, seconds, hundredths (This time does NOT include the time
  721.     it takes to load the program from disk). Changes show if the program
  722.     has left any memory still allocated. i.e. if 200 bytes of chip
  723.     memory were left allocated by the program, then 'chip: -200'
  724.  
  725.     ------------------------------------------------------------------------
  726.     STRINGS sourcefile [count]
  727.  
  728.     * STRINGS displays all valid ASCII strings in a file which have a
  729.       length greater than or equal to the count. If no count is given,
  730.       a default of 10 characters is used.
  731.     * This command is very useful for finding out which libraries a
  732.       program uses.
  733.  
  734.     eg.    strings c:zshell 12
  735.  
  736.     ------------------------------------------------------------------------
  737.     TIME
  738.  
  739.     * Displays the current time in hours:minutes:seconds.hundredths
  740.  
  741.     ------------------------------------------------------------------------
  742.     TYPE source
  743.  
  744.     * Prints to the screen the ASCII text file specified as 'source'.
  745.       Hitting any key will pause the listing. Backspace will restart it.
  746.       CTRL <C> will abort the listing.
  747.  
  748.     eg.   type readme
  749.     ------------------------------------------------------------------------
  750.     UNSET [set1] [set2] [set3] [set4] ... [set11]
  751.  
  752.     * Removes one or more set definitions from the set list.
  753.  
  754.     eg.    set f1 "cd df0:;diw^M"
  755.         set f2 "cd df1:;diw^M"
  756.         ...
  757.  
  758.         set f10 "ed df1:s/startup-sequence^M"
  759.         ...
  760.  
  761.         unset f1 f2 f3 f4 f5 f6 f7 f8 f9
  762.         ...
  763.  
  764.         unset f10
  765.     ------------------------------------------------------------------------
  766.     VEC
  767.  
  768.     * Displays some important execbase pointers, which give a good
  769.       indication of whether a virus is present in your system.
  770.       WarmCapture, CoolCapture, ColdCapture, KickTagPtr, KickMemPtr,
  771.       and KickCheckSum are displayed. If any of these are are NOT
  772.       zero, then either a virus, RAD, or virus protector or some
  773.       other program that takes control of your machine when you
  774.       reset, is present. If you suspect a virus, you may want to eject
  775.       the disk from DF0: and type the RESET command, which should
  776.       clear the virus. Now you should boot up on a clean disk.
  777.  
  778.     eg.    vec
  779.     ------------------------------------------------------------------------
  780.     VERSION
  781.  
  782.     * Tells you ZShell's version number.
  783.  
  784.     eg.   version
  785.     ------------------------------------------------------------------------
  786.     ; blah blah blah blah
  787.     * etc etc etc
  788.     # hello ma
  789.  
  790.     * Placing a semi-colon, an asterisk or a hash character as the 1st
  791.       character in the line of a script file allows you to place comments
  792.       in it.
  793.  
  794.     eg.   ; This is a comment line
  795.     ------------------------------------------------------------------------
  796.  
  797.  
  798.     HISTORY & COMMAND LINE EDITING
  799.     ==============================
  800.  
  801.       ZShell has a 1024 byte circular history buffer. It works similar
  802.     to most other shells and the NEWCON: handler in Workbench V1.3.
  803.  
  804.     UP ARROW    - go back one line in the history buffer.
  805.     DOWN ARROW    - go forward one line in the history buffer.
  806.     SHIFT UP ARROW    - go to the 1st line in the history buffer.
  807.     SHIFT DOWN ARROW- go to the last line in the history buffer, which
  808.               should be blank.
  809.     LEFT ARROW    - move cursor left.
  810.     RIGHT ARROW    - move cursor right.
  811.     SHIFT LEFT ARROW- move cursor one word left.
  812.     SHIFT RIGHT ARROW move cursor one word right.
  813.  
  814.     CTRL X        - deletes whole line.
  815.     CTRL E        - move cursor to end of line.
  816.     CTRL Z        - move cursor to start of line.
  817.  
  818.       Again, command line editing is similar to most shells. Backspace
  819.     and delete do what they're supposed to do.
  820.  
  821.     WILD CARDS
  822.     ==========
  823.  
  824.       As at V1.09, ZShell supports wild card file descriptions on some
  825.     commands (DIR, DIW, DELETE & COPY). Wild cards are like those
  826.     supported on MS-DOS systems, and not the same as the ones on
  827.     AMIGA DOS. NOTE: You can only effectively put one * character in a
  828.     wild card.
  829.  
  830.     Character    Meaning
  831.     ---------    -------
  832.        *        Match zero or more characters.
  833.        ?        Match one character.
  834.        ~        Negates the following wildcard.
  835.      [  ]        Specifies a class of characters to match.
  836.  
  837.     eg.    diw *.info    {lists all .info files}
  838.            dir z*.s        {lists all files starting z, ending in .s}
  839.            delete *.info    {deletes all .info files}
  840.            copy *.s ram:    {copies all .s files to ram:}
  841.            copy 1? df1:    {copies all two char files beginning with 1}
  842.            dir ~*.s        {lists all files NOT ending in .s}
  843.            dir ~*.info    {lists all files except for .info files}
  844.            dir *.[co]    {lists files ending in .c or .o}
  845.            dir [abcd]*    {lists files beginning with a,b,c or d}
  846.  
  847.     INPUT/OUTPUT REDIRECTION
  848.     ========================
  849.  
  850.       The standard redirection operators are supported for all internal
  851.     commands, as well as disk based programs. Redirection only affects
  852.     those programs which use the dos.library's Input() and Output()
  853.     functions.
  854.  
  855.         >  redirect std output.
  856.         <  redirect std input.
  857.         >> append redirect output. (tacks output onto the end of file)
  858.  
  859.     eg.    diw df1:c >ram:directory
  860.            type zshell.doc <raw:0/0/100/100/input >raw:0/0/640/100/output
  861.            sortfile things >>df0:things.log
  862.  
  863.  
  864.     EXECUTING COMMANDS FROM DISK
  865.     ============================
  866.  
  867.       Just type the program's name, the same as you would at the
  868.     1> prompt. Note that you do NOT need the RUN command in the C:
  869.     directory.
  870.  
  871.  
  872.     HOW TO RUN IT BIT
  873.     =================
  874.  
  875.       ZShell must be started from the CLI.
  876.  
  877.     eg.   1> ZShell
  878.  
  879.       When ZShell is loaded, it trys to load the DEFAULT SCRIPT FILE
  880.     called LOGIN.Z. First the S: directory is checked for it, followed
  881.     by the current directory. Once loaded, the script is executed.
  882.  
  883.       You can automatically execute a ZShell script file when starting
  884.     up ZShell by including the script file's name on the CLI line.
  885.  
  886.     eg.   1> ZShell script.z
  887.  
  888.       You can call ZShell script files anything you like (they don't
  889.     have to end in .z)
  890.  
  891.  
  892.     EXAMPLE STARTUP SCRIPTS
  893.     =======================
  894.  
  895.     eg.    You want to set up one of those utilities disks where
  896.         everything operates by pressing function keys.
  897.  
  898. ; UTILITY DISK STARTUP SCRIPT
  899. set f1 Amigamon^M
  900. set f2 PaulCopy^M
  901. set f3 Fixdisk^M
  902. set f4 FastDisk^M
  903. set f5 trackdos^M
  904. set f6 zerovirus^M
  905. set f7 novirus^M
  906. set f8 WayneCopy^M
  907. set f9 powerpacker^M
  908. set f10 dirwork^M
  909. set F1 dirutil^M
  910. set F2 diskspin^M
  911. set F3 pprefs^M
  912. set F4 "mount msh:^M"
  913. set F5 sound_ripper1^M
  914. set F6 sound_ripper2^M
  915. set F7 VirusExpert^M
  916. set F8 reset^M
  917. set F9 "cd df0:;diw^M"
  918. set F10 "ed df0:s/startup-sequence^M"
  919. set help "type sys:menu"
  920. help
  921. ; END OF SCRIPT
  922.  
  923.     * Obviously you'd call this file something like zstart.z, and shove
  924.       it in your s: directory. Then put in your startup-sequence ;
  925.  
  926.         ZShell s:zstart.z
  927.  
  928.       And make sure the text file 'menu' has the proper menu of function
  929.     keys.(NB. You could also call it LOGIN.Z, and shove it in the S:
  930.     directory. And just put the following in the startup-sequence ;
  931.     
  932.         ZShell
  933.  
  934.     -----------------------------------------------------------------------
  935.     eg.    You want to set up a CLI work disk.
  936.  
  937. ; CLI DISK STARTUP SCRIPT
  938. echo "**** MY CLI DISK ****"
  939. copy c:ed ram:
  940. set f1 "cd df0:^M"
  941. set F1 "cd df1:^M"
  942. set f2 diw^M
  943. set F2 "diw c^M"
  944. set f3 "cd df0:;diw^M"
  945. set F3 "cd df1:;diw^M"
  946. set f4 WayneCopy^M
  947. set F4 PaulCopy^M
  948. set f5 "ed "
  949. set F5 "zap^M"
  950. set f6 "type df1:contents^M"
  951. set f10 "ed df0:s/startup-sequence^M"
  952. set F10 "ed df1:s/startup-sequence^M"
  953. set cl "%1 cd $1;diw"
  954. set cls "echo ^L"
  955. set mm "%1 more $1 30"
  956. ; NOW AS A STINGY MENU, SHOW THE CURRENT SETTINGS
  957. set
  958.  
  959.  
  960.     FUTURE
  961.     ======
  962.  
  963.     * Needs to be extra stuff to make the script language flexible.
  964.     * Probably should have date stuff (I don't have a clock)
  965.  
  966.     CREDITS
  967.     =======
  968.  
  969.       Many thanks to Wayne for his invaluable help in doing the history
  970.     and command line editing parts of ZShell. Also, thanks to
  971.     Tim Strachan who asked for the history stuff.
  972.  
  973.       ZShell was entirely written using Wayned by Wayne Hayter (various
  974.     versions). And was assembled with A68K V2.61 by Charlie Gibbs. And
  975.     linked with Blink V6.7 by the Software Distillery.
  976.  
  977.     IN THIS DIRECTORY
  978.     =================
  979.  
  980.     Included with this distribution of ZShell are the following files:
  981.  
  982.     ZShell        : the shell
  983.     ZShell.doc    : This doc file
  984.     ZShell.s.lzh    : The lharc'ed assembly source code for ZShell
  985.     
  986.  
  987.     DISTRIBUTION
  988.     ============
  989.  
  990.     ZSHELL IS FREELY DISTRIBUTABLE. YOU CAN DISTRIBUTE THIS AS LONG AS
  991.     THIS DOC FILE REMAINS WITH THE EXECUTABLE, AND THAT NO CHARGE IS MADE FOR
  992.     THEM (APART FROM A NOMINAL COPYING CHARGE). IF YOU FEEL LIKE SENDING
  993.     ME SOMETHING FOR THIS PROGRAM, SEND ME A POSTCARD!, A P.D. DISK, A
  994.     PROGRAM YOU'VE BEEN WORKING ON ,BUT DON'T SEND ME ANY MONEY (WELL, IF
  995.     YOU REALLY, REALLY WANT TO, I GUESS I COULD PUT UP WITH IT).
  996.     
  997.  
  998.     CORRESPONDENCE & BUG REPORTS
  999.     ============================
  1000.  
  1001.       Please send any correspondence and/or bug reports to me at the
  1002.     address below:-
  1003.  
  1004.         Paul Hayter
  1005.         PO Box 331
  1006.         Ballina
  1007.         2478
  1008.         Australia.
  1009.